package com.gshrms.org.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gshrms.common.annotation.DataScope;
import com.gshrms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gshrms.org.mapper.OrgPostMapper;
import com.gshrms.org.domain.OrgPost;
import com.gshrms.org.service.IOrgPostService;

/**
 * 职位Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class OrgPostServiceImpl extends ServiceImpl<OrgPostMapper,OrgPost> implements IOrgPostService
{
    @Autowired
    private OrgPostMapper orgPostMapper;

    /**
     * 查询职位
     * 
     * @param postId 职位主键
     * @return 职位
     */
    @Override
    public OrgPost selectOrgPostByPostId(Long postId) {
        return orgPostMapper.selectOrgPostByPostId(postId);
    }

    /**
     * 查询职位列表
     * 
     * @param orgPost 职位
     * @return 职位
     */
    @Override
    public List<OrgPost> selectOrgPostList(OrgPost orgPost) {
        return orgPostMapper.selectOrgPostList(orgPost);
    }

    /**
     * 新增职位
     * 
     * @param orgPost 职位
     * @return 结果
     */
    @Override
    public int insertOrgPost(OrgPost orgPost) {
        orgPost.setCreateTime(DateUtils.getNowDate());
        return orgPostMapper.insertOrgPost(orgPost);
    }

    /**
     * 修改职位
     * 
     * @param orgPost 职位
     * @return 结果
     */
    @Override
    public int updateOrgPost(OrgPost orgPost) {
        orgPost.setUpdateTime(DateUtils.getNowDate());
        return orgPostMapper.updateOrgPost(orgPost);
    }

    /**
     * 批量删除职位
     * 
     * @param postIds 需要删除的职位主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostByPostIds(Long[] postIds) {
        return orgPostMapper.deleteOrgPostByPostIds(postIds);
    }

    /**
     * 删除职位信息
     * 
     * @param postId 职位主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostByPostId(Long postId) {
        return orgPostMapper.deleteOrgPostByPostId(postId);
    }
}
